package cn.wjzhang.middle.runner;

import cn.wjzhang.middle.factory.SeniverseFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * ========================
 * 启动类
 *
 * @author wjzhang
 * @version v1.0
 * ========================
 * @date 2023/7/5 9:05
 */
@Component
//如果有多个runner需要指定一些顺序
@Order(1)
public class MidApplicationRunner implements ApplicationRunner {
    // 网关
    @Value("${seniverse.host}")
    private String host;
    // 授权
    @Value("${seniverse.key}")
    private String key;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        SeniverseFactory.init(host, key);
    }

}
